<!doctype>
<html>
	<head>
		
	</head>
	<body>

<script>
async function gen(x){
    var y = await x + 2;
    var z = await y + 2;
    return z;
}
gen(1).then(result => console.log(result), error => console.log(error));
gen(1).then(result => console.log(result)).catch(error => console.log(error));
</script>			

	</body>
</html>